﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Amba.NotFoundLog.Models;
using Orchard.Data;
using Orchard.UI.Admin;

namespace Amba.NotFoundLog.Controllers
{
    [Admin]
    public class AdminController : Controller
    {
        private IRepository<NotFoundLogRecord> _repository;

        public AdminController(IRepository<NotFoundLogRecord> repository)
        {
            _repository = repository;
        }

        public ActionResult Index()
        {
            var result = _repository.Table.OrderByDescending(x => x.LogDate).Take(500).ToList();
            return View(result);
        }
    }
}